#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int massage(vector<int>& nums) {

        int m = nums.size();
        if (m == 0) return 0;
        vector<int>dp1(m);
        vector<int>dp2(m);
        dp1[0] = nums[0], dp2[0] = 0;
        for (int i = 1; i < m; i++)
        {
            dp1[i] = dp2[i - 1] + nums[i];
            dp2[i] = max(dp1[i - 1], dp2[i - 1]);
        }
        return max(dp1[m - 1], dp2[m - 1]);
    }
};